<template>
  <el-form :model="props" label-position="right" label-width="120">
    <el-form-item label="基本信息：">
      <el-input
        :rows="4"
        v-model="props.data.npc_prf_bas"
        type="textarea"
      ></el-input>
    </el-form-item>
    <el-form-item label="性格特点：">
      <el-input
        :rows="4"
        v-model="props.data.npc_prf_char"
        type="textarea"
      ></el-input>
    </el-form-item>
    <el-form-item label="形象描述：">
      <el-input
        :rows="4"
        v-model="props.data.npc_prf_outfit"
        type="textarea"
      ></el-input>
    </el-form-item>
    <el-form-item label="自我描述：">
      <el-input
        v-model="props.data.npc_prf_selfintro"
        type="textarea"
        :rows="4"
      ></el-input>
    </el-form-item>
    <el-form-item label="角色头像：">
      <el-upload
        class="avatar-uploader"
        :show-file-list="false"
        :auto-upload="false"
      >
        <img v-if="imageUrl" :src="imageUrl" class="avatar" />
        <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
      </el-upload>
    </el-form-item>
    <el-form-item label="角色背景设定：">
      <el-input
        :rows="4"
        v-model="props.data.npc_prf_bg"
        type="textarea"
      ></el-input>
    </el-form-item>
  </el-form>
</template>
<script setup>
import { ref, onMounted } from "vue";

const imageUrl = ref("");

const props = defineProps({
  data: Object,
});
</script>

<style lang="scss" scoped>
.avatar-uploader .avatar {
  width: 178px;
  height: 178px;
  display: block;
}
</style>
<style>
.avatar-uploader .el-upload {
  border: 1px dashed var(--el-border-color);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--el-transition-duration-fast);
}

.avatar-uploader .el-upload:hover {
  border-color: var(--el-color-primary);
}

.el-icon.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  text-align: center;
}
</style>
